package day01_homework;

public class Test01 {
    public static void main(String[] args) {
        String fileName = "logo.jpg";//jpg
        String fileName2 = "jquery.1.1.2.js";//js

        String ext = getExtByName(fileName);
        System.out.println(ext);
        ext = getExtByName(fileName2);
        System.out.println(ext);
    }

    public static String getExtByName(String name) {
        int index = name.lastIndexOf(".");
        String ext = name.substring(index + 1);
        return ext;
    }
}
